package xkp.lesson1;

public class Demo1 {
	public static void main(String[] args) throws CloneNotSupportedException {
		Car car = new Car("宝马", "123456");
		Driver driver1 = new Driver("张三", 20, "abcd", car);
		Driver driver2 = new Driver("张三", 20, "abcd", car);
		System.out.println(driver1);
		System.out.println(driver1.equals(driver2));
		System.out.println(driver1 == driver2);
		
		Driver driver3 = new Driver(driver1);
		//driver1.getCar().setCarNum("234567");
		//System.out.println(driver3);
		
		Driver driver4 = (Driver) driver1.clone();
		driver1.getCar().setCarNum("234567");
		System.out.println(driver4);
	}
}
